package api;

import java.util.Scanner;

public class String4 {
    public static void main(String[] args) {
        String username = "zhangsan";
        String password = "123456";

        for (int i = 0; i < 3; i++) {
            Scanner sc = new Scanner(System.in);
            System.out.println("请输入账号");
            String USERNAME = sc.next();
            System.out.println("请输入密码");
            String PASSWORD = sc.next();

            if (username.equals(USERNAME) && password.equals(PASSWORD)) {
                System.out.println("用户登录成功");
                break;
            } else {
                if (i == 2) {
                    System.out.println("账号" + username + "已被锁定，请联系客服小哥哥0350-3484");
                } else {
                    System.out.println("账号或密码不正确,还剩" + (2 - i) + "次机会");
                }
            }
        }
    }
}
